package com.rhb.ca.uzer.bean;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

import com.rhb.ca.util.MD5;

public class Uzer implements Serializable{
	
	protected String uzerPk;
	protected String uzerName;
	protected String loginName;
	protected String password;
	protected Set roles = new HashSet();
	
	public Uzer(){
	}

	public void setUzerName(String str){
		this.uzerName = str;
	}
	public String getUzerName(){
		return this.uzerName;
	}

	public void setUzerPk(String str){
		this.uzerPk = str;
	}
	public String getUzerPk(){
		return this.uzerPk;
	}


	public void setLoginName(String str){
		this.loginName = str;
	}
	public String getLoginName(){
		return this.loginName;
	}


	public void setPassword(String password){
		this.password = password;
	}
	public void encryptPassword(String password){
		this.password = MD5.encrypt(password);
	}
	public String getPassword(){
		return this.password;
	}
	
	public void setRoles(Set sr){
		this.roles = sr;
	}
	
	public Set getRoles(){
		return this.roles;
	}
	

	public boolean passwordEquals(String pass){
		if(pass!=null&&(this.password.equals(pass)||this.password.equals(MD5.encrypt(pass))))
			return true;
		else return false;
	}
}